import { createRouter, createWebHashHistory } from 'vue-router'
export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      component: () => import('../pages/login/index.vue'),
    },
    {
      path: '/my',
      component: () => import('../layout/my/index.vue'),
      children: [
        {
          path: 'order',
          component: () => import('../pages/my/order/index.vue'),
          name: '订单页面',
        },
      ]
    },
    {
      path: '/index',
      component: () => import('../pages/home/index.vue')
    },
    {
      path: '/ticket',
      component: () => import('../layout/ticket/index.vue'),
      children: [
        // {
        //   path: 'choose',
        //   component: () => import('../pages/ticket/choose/index.vue'),
        //   name: '选票页面',
        // },
        {
          path: 'buy',
          name: '购票页面',
          component: () => import('../pages/ticket/buy/index.vue'),
        },
        {
          path: 'check',
          name: '检票页面',
          component: () => import('../pages/ticket/check/index.vue'),
        }
      ]
    },
    {
      path: '/rate',
      component: () => import('../pages/rate/index.vue')
    },
    {
      path: '/movie',
      component: () => import('../pages/movie/index.vue')
    },
    {
      path: '/manage',
      component: () => import('../layout/manage/index.vue'),
      children: [
        {
          path: 'sys-manager',
          component: () => import('../pages/dashboard/sys-manager/index.vue'),
          name: '系统管理员',
          redirect: 'cinema',
          children: [
            {
              path: 'cinema',
              component: () => import('../pages/dashboard/sys-manager/cinema/index.vue'),
              name: '影院管理',
            },
            {
              path: 'account',
              name: '影院管理员管理',
              component: () => import('../pages/dashboard/sys-manager/account/index.vue'),
            }
          ]
        },
        {
          path: 'movie-manager',
          component: () => import('../pages/dashboard/movie-manager/index.vue'),
          name: '影院管理员',
          redirect: 'movie',
          children: [
            {
              path: 'movie',
              name: '电影管理',
              component: () => import('../pages/dashboard/movie-manager/movie/index.vue'),
            },
            {
              path: 'room',
              name: '影厅管理',
              component: () => import('../pages/dashboard/movie-manager/room/index.vue'),
            },
            {
              path: 'updateSeat',
              name: '更新座位',
              component: () => import('../pages/dashboard/movie-manager/seat/updateSeat/index.vue'),
            },
            {
              path: 'addClass',
              name: '排班管理',
              component: () => import('../pages/dashboard/movie-manager/class/index.vue'),
            },
            {
              path: 'viewSeat',
              name: '查看座位',
              component: () => import('../pages/dashboard/movie-manager/seat/viewSeat/index.vue'),
            },
            {
              path: 'countMovie',
              name: '统计电影票房',
              component: () => import('../pages/dashboard/movie-manager/count/countMovie/index.vue')
            },
            {
              path: 'countSeat',
              name: '统计入座率',
              component: () => import('../pages/dashboard/movie-manager/count/countSeat/index.vue')
            },
          ]
        }
      ]
    }
  ]
})